package com.jacky.iot.config;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jacky.iot.commons.InstantTypeAdapter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.Instant;

@Configuration
public class CommonConfig {

    @Bean
    public Gson gson() {
        return new GsonBuilder()
                .registerTypeAdapter(Instant.class, new InstantTypeAdapter())
                .create();
    }
}
